package com.hankol.community.adapter

import com.baselibrary.extension.checkValue
import com.baselibrary.extension.load
import com.baselibrary.utils.NumberUtils
import com.baselibrary.utils.TimeUtil
import com.baselibrary.view.RoundCornerImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.R
import com.hankol.community.bean.ColumnDetailsListBean


/**专栏详情 列表
 *@author:hanke
 *2022/3/30
 *desc:
 */
class ColumnDetailsListAdapter :
    BaseQuickAdapter<ColumnDetailsListBean, BaseViewHolder>(R.layout.item_column_details) {

    override fun convert(helper: BaseViewHolder, item: ColumnDetailsListBean) {
        helper.getView<RoundCornerImageView>(R.id.riv_cover).load(mContext, item.cover.checkValue())
        helper.setText(R.id.tv_title, item.title.checkValue())
            .setText(R.id.tv_time_play_num, "${TimeUtil.fromToday(item.ctime)}  ${NumberUtils.formatBigNum("${item.readNum}")}阅读")
    }
}